interface Strategy {
    doOperation(num1: number, num2: number): number;
}

class OperationAdd implements Strategy {
    public doOperation(num1: number, num2: number): number {
        return num1 + num2;
    }
}

class OperationSubstract implements Strategy {
    public doOperation(num1: number, num2: number): number {
        return num1 - num2;
    }
}

class OperationMultiply implements Strategy {
    public doOperation(num1: number, num2: number): number {
        return num1 * num2;
    }
}

class Context {
    private strategy: Strategy;
    public constructor(strategy: Strategy) {
        this.strategy = strategy;
    }
    public executeStrategy(num1: number, num2: number): number {
        return this.strategy.doOperation(num1, num2);
    }
}

function main() {
    const context: Context = new Context(new OperationAdd());
    console.log('2 + 3 = ' + context.executeStrategy(2, 3)); // Output: 5
    const context2: Context = new Context(new OperationSubstract());
    console.log('5 - 3 = ' + context2.executeStrategy(5, 3)); // Output: 2
    const context3: Context = new Context(new OperationMultiply());
    console.log('2 * 3 = ' + context3.executeStrategy(2, 3)); // Output: 6
}

main();
